package com.aloha.springframework.test.bean.impl;

import com.aloha.springframework.stereotype.Component;
import com.aloha.springframework.test.bean.IUserDao;

import java.util.HashMap;
import java.util.Map;

@Component
public class UserDao implements IUserDao {

    private static final Map<String, String> hashMap = new HashMap<>();

    static {
        hashMap.put("1", "董柯11");
        hashMap.put("2", "董柯22");
        hashMap.put("3", "董柯33");
    }

    public void initDataMethod() {
        hashMap.put("4", "董柯4");
        hashMap.put("5", "董柯5");
        hashMap.put("6", "董柯6");
    }

    @Override
    public String queryUserName(String id) {
        return hashMap.get(id);
    }

    @Override
    public void testAop() {
        System.out.println("被代理的方法执行了。。。。");
    }

}
